<template>
  <div id="Contaier">
    <button class="btn btn-primary back" @click="back">返回</button>
    <div class="input-group">
      <div class="input-group-prepend">
        <span class="input-group-text">写下你的评论吧</span>
      </div>
      <textarea class="form-control" aria-label="With textarea" v-model="ReviewContent"></textarea>
      <button class="btn btn-success submit" @click="Submit">提交</button>
    </div>
  </div>
</template>

<script>
export default {
  data(){
    return{
      ReviewContent:''
    }
  },
  methods: {
    back() {
      this.$router.push('/home/MyVoluntary')
    },
    Submit(){
      if(this.ReviewContent==''||this.ReviewContent==null){
        alert('评论不能为空')
      }      
      this.axios.post(
        '/SelectIdentity/Voluntary/WriteReview',
        {
          vAandVID:this.$route.params.id,
          reviewContent:this.ReviewContent
        }
      ).then(res=>{
        if(res.data){
          alert('评论成功')
        }
        else{
          alert('评论失败')
        }
      })
    }
  }
}
</script>

<style lang="less" scoped>
#Contaier {
  padding: 0;
  margin: 0;
  height: 100%;
  width: 100%;
  position: relative;
  .back {
    position: relative;
    left: 0px;
    top: 0px;
  }
  .submit{
    position: relative;
    right: 0px;
    bottom: 0px;
  }
}
</style>